{template('../public/header.html')}

<div id="J_ajax_loading" class="ajax_loading">提交请求中，请稍候...</div>
<div class="subnav">
	<div class="content_menu ib_a blue line_x">
		<a class="add fb J_showdialog" href="javascript:void(0);" data-uri="{:U('music_cate/add')}" data-title="添加菜单" data-id="add" data-width="500" data-height="350"><em>添加栏目</em></a>
	</div>
</div>
<!--栏目列表-->
<div class="pad_10">
    <div class="J_tablelist table_list" data-acturi="{:U('music_cate/ajax_edit')}">
    <table width="100%" cellspacing="0" id="J_cate_tree">
        <thead>
            <tr>
                <th width="30"><input type="checkbox" name="checkall" class="J_checkall"></th>
              	<th align="left">栏目名称</th>
                <th width="60"><span data-tdtype="order_by" data-field="id">ID</span></th>
				<th width="100">栏目图片</th>
              	<th width="80"><span data-tdtype="order_by" data-field="ordid">{:L('sort_order')}</span></th>
                <th width="60"><span data-tdtype="order_by" data-field="status">{:L('status')}</span></th>
                <th width="150">{:L('operations_manage')}</th>
            </tr>
        </thead>
    	<tbody>
		{foreach e cat}
			<tr id='node-{:cat(e)("id")}' {if cat(e)("pid")>0}class="child-of-node-{:cat(e)("pid")}"{else} {/if}>
                <td align='center'><input type='checkbox' value='{:cat(e)("id")}' class='J_checkitem'></td>
                <td>{:cat(e)("tree_spacer")}<span data-tdtype='edit' data-field='name' data-id='{:cat(e)("id")}' class='tdedit'>{:cat(e)("name")}</span></td>
                <td align='center'>{:cat(e)("id")}</td>
                <td align='center'>{if not ab.c.isnul(cat(e)("img"))}<div class="img_border"><img src="{:cat(e)("img")}" width="26" height="26" class="J_preview" data-bimg="{:cat(e)("img")}"/></div>{else}&nbsp;{/if}</td>
                <td align='center'><span data-tdtype='edit' data-field='ordid' data-id='{:cat(e)("id")}' class='tdedit'>{:cat(e)("ordid")}</span></td>
                <td align='center'><img data-tdtype="toggle" data-id="{:cat(e)("id")}" data-field="status" data-value="{:cat(e)("status")}" src="__STATIC__/images/admin/toggle_{if cat(e)("status")=1}enabled{else}disabled{/if}.gif" /></td>
                <td align='center'>
					<a href="javascript:;" class="J_showdialog" data-uri="{:U('music_cate/add?pid='& cat(e)("id"))}" data-title="添加栏目" data-id="add" data-width="500" data-height="360">添加子栏目</a> |
					<a href="javascript:;" class="J_showdialog" data-uri="{:U('music_cate/edit?id='& cat(e)("id"))}" data-title="{:L('edit')} - {:cat(e)("name")}" data-id="edit" data-width="500" data-height="360">{:L('edit')}</a> |
					<a href="javascript:;" data-acttype="ajax" class="J_confirmurl" data-uri="{:U('music_cate/delete?id='& cat(e)("id"))}" data-msg='确定要删除“<font color=blue>{:cat(e)("name")}</font>”吗？'>{:L('delete')}</a></td>
			</tr>
		{/foreach}
    	</tbody>
    </table>
    </div>
    <div class="btn_wrap_fixed">
        <label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
        <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('music_cate/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
    </div>
</div>
{template('../public/footer.html')}
<script src="__STATIC__/js/jquery/plugins/jquery.treetable.js"></script>
<script>
$(function(){
    //initialState:'expanded'
    $("#J_cate_tree").treeTable({indent:20,treeColumn:1});
});
</script>
</body>
</html>